#pragma once
#include "egui.h"

class CChessWidget :
	public CImageWidget
{
public:
	CChessWidget(void);
	int m_nX;
	int m_nY;
	bool m_bLastChessFlag;
	
	BOOL isMe(int x,int y)
	{
		if(x==m_nX && y==m_nY)
		{
			return TRUE;
		}
		return FALSE;
	}
	CChessWidget(WEIQI_SIDE_T chess_type,int x,int y)
	{
		m_nX=x;
		m_nY=y;
		if(chess_type==WEIQI_SIDE_WHITE)
		{
			char* draw_cmd = "H:1,24,0,24,24,1,BMP_MASK:2,48,0,24,24,72,0,24,24,";
			setImage("resource/qizi.bmp",draw_cmd);


		}
		if(chess_type==WEIQI_SIDE_BLACK)
		{
			char* draw_cmd = "H:1,0,0,24,24,1,BMP_MASK:2,48,0,24,24,72,0,24,24,";
			setImage("resource/qizi.bmp",draw_cmd);

		}
		m_bLastChessFlag=false;


	}

	virtual int CustDraw(CFrameSurface* pSurface)
	{
		return CImageWidget::CustDraw(pSurface);
		
	}
	virtual ~CChessWidget(void);
};